<!DOCTYPE html>
<!-- saved from url=(0048)http://v3.bootcss.com/examples/navbar-fixed-top/ -->
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="./img/icon.png">

    <title>Fixed Top Navbar Example for Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="./css/bootstrap.min.css" rel="stylesheet">
	
	<link href="./css/navbar-fixed-top.css" rel="stylesheet">
	<link href="./css/index.css" rel="stylesheet">
	
</head>
<body>
    <div class="container">
		<h1 class="center-block text-center" style="max-width:400px;position: relative">
			<a href="/"><span class="glyphicon glyphicon-home inline_icon" id="back_icon"></span></a>
			NJUST 旅游网络系统
		</h1>
		<div class="" id="view_login">
			<form id="modal_login_form" role="form" class="center-block" method="post" action="logincheck.php" onsubmit="return ajax_login()" style="max-width:400px">
				<div class="clearfix">
					<h4 class="pull-left">登陆</h4>
					<h4 class="pull-right">没有账号?<a id="show_register" href="">注册</a></h4>
				</div>
				
				
				<input type="hidden" name="redirect_to" value="">
				<div class="form-group">
					<input type="text" class="form-control" name="username" value="" placeholder="用户名">
				</div>
				<div class="form-group">
					<input type="password" class="form-control" name="password" placeholder="密码">
				</div>
				<div class="form-group"><button type="submit" class="btn btn-primary btn-block">登陆</button></div>
				
			</form>
		</div>
		<div class="hidden" id="view_register">

			<form class="center-block" method="POST" action="register.php" style="max-width: 400px">
				<div class="clearfix">
					<h4 class="pull-left">注册</h4>
					<h4 class="pull-right">已有账号?<a id="show_login" href="">登陆</a></h4>
				</div>
				
				<input type="hidden" name="redirect_to" value="/Profile/">
				<div class="form-group"><input class="form-control" type="text" name="username" value="" placeholder="用户名"></div>
				
				<div class="form-group"><input class="form-control" type="email" name="email" value="" placeholder="邮箱"></div>
				<div class="form-group"><input class="form-control" type="password" name="password" placeholder="密码"></div>
				<div class="form-group"><input type="password" class="form-control" name="password_repeat" placeholder="重复密码"></div>
				<div class="form-group"><button class="btn btn-primary btn-block" type="submit">注册</button></div>
			</form>
		</div>
	</div>

	<!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
	
	<script src="./js/require.js"></script>
    
	<script src="./js/jquery-1.11.0.min.js"></script>
	<!--
    <script src="./js/jquery.min.js"></script>
	-->
	<script src="./js/bootstrap.min.js"></script>
	<script>
		$('#show_register').click(function() {
		    $("#view_login").toggleClass("hidden");
            $("#view_register").toggleClass("hidden");
            return false;
        });
    
		
		$(function(){
			
			$('.onhover-dropdown').hover(function() {
				$(".onhover-dropdown").not(this).removeClass("open");
			},function(){});
			
			$('.modal').on('shown.bs.modal',function(){
				$(this).find('input[type="text"]')[0].focus();
			})
			
			NJOJ = Object();
			NJOJ.local_settings = localStorage['local_settings'] && JSON.parse(localStorage['local_settings']) || {};
			NJOJ.local_settings.save = NJOJ.local_settings.save || function(){
				localStorage['local_settings'] = JSON.stringify(this);
			}
			$('html').attr('style',null)
			
		});
		
		function pop_Regisger()
		{
			$('#register_modal-dialog').modal('show');
			return false;
		}
		function pop_Login() {
			$('#login_modal-dialog').modal('show');
			return false;
		}
		
		function ajax_post(form,callback) {
			$.post(form.attr('action'),
			form.serialize(), 
			function(data, status) {
				//alert("数据：" + data.status + "\n状态：" + status);
				if (status == "success") {
					callback(data)
				}
			},
			"json");
		}
		
		function ajax_login() {
			var form=$("#modal_login_form")
			form.find('.form-group').removeClass('has-error');
			ajax_post(form, function(rep) {
				//$("#content").val(rep.status);
				if (rep.status == "success") {
					//alert("!!");
					window.location.href = "http://localhost/tour/index.php";//reload();
				} else {
					for (err in rep.errors) {
						gp = form.find("[name='"+err+"']").parent()
						gp.find("label").text(rep.errors[err][0]);
						gp.addClass('has-error')
					}
				}
			});
			//alert("!");
			return false;
		}
		function ajax_logout()
		{
			$.get(
				'logout.php',
				function(data, status){
					//alert("数据：" + data.status+ "\n状态" + status);
					window.location.reload();
				},
				"json");
			return false;
		}
		/*
		$("#search_form_xs,#nav_search_form").on("submit",function(){
			val = $(this).find("input").val();
			Pid=val.match(/\d{4}/) || val.match(/\d+[A-Z]/);
			repo = "Pku"
			if (val.match(/Pku|POJ/i))
				repo = "Pku";
			if (val.match(/Zju|ZOJ/i))
				repo = "Zju"
			if (val.match(/Hdu/i))
				repo = "Hdu"
			if (val.match(/CF/i))
				repo = "CF"
			window.location.assign("/Problem/"+repo + "/" + Pid + "/");
			return false;
		});
		function script_ready(){
			var callback = arguments[arguments.length-1];
			var remain = arguments.length-1;
			for (var i = arguments.length-2;i >= 0 ;i--){
				var script = document.createElement('script');
				script.setAttribute('type','text/javascript');
				script.src = arguments[i];
				script.onload=function(){
					--remain || callback();
				}
				document.body.appendChild(script);
			}
		}
		*/
	</script>

    
    
</body>
</html>